Skip to content

Add programmatic model builder API#1655

Open
Copilot wants to merge 3 commits intomasterfrom
copilot/add-programmatic-model-builder-again
Open

Add programmatic model builder API#1655
Copilot wants to merge 3 commits intomasterfrom
copilot/add-programmatic-model-builder-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 4, 2026

Casbin models are currently defined only via text files (model.conf), making programmatic composition and refactoring cumbersome in larger projects.

Changes

Added model.Builder with fluent API for programmatic model construction:

  • Request(), Policy(), Role() - Define model sections via variadic field lists
  • Effect(), Matcher() - Set effect and matcher expressions as strings
  • Build() - Generates standard Model instance compatible with existing enforcement
  • ToString() - Outputs CONF format for debugging/serialization

Example

m, _ := model.New().
    Request("sub", "obj", "act").
    Policy("sub", "obj", "act").
    Role("_", "_").
    Effect("some(where (p.eft == allow))").
    Matcher("g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act").
    Build()

e, _ := casbin.NewEnforcer(m, adapter)

Generated models are semantically identical to file-based models. Core enforcement logic unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>[feature] Programmatic model builder</issue_title>
<issue_description>## Background

Casbin models are currently defined as plain text (model.conf).
While flexible, this makes it inconvenient to analyze, refactor, or compose models programmatically, especially in larger or long-lived projects.

This proposal explores adding a programmatic way to construct models, without changing existing semantics or model behavior.

Proposal

Introduce an optional model builder that allows Casbin models to be constructed in code and then converted into a standard Casbin model.

Example (conceptual):

model := builder.New().
    Request("sub", "obj", "act").
    Policy("sub", "obj", "act").
    Effect(builder.AllowOverride).
    Matcher(
        builder.And(
            builder.Eq("sub"),
            builder.Eq("obj"),
            builder.Eq("act"),
        ),
    ).
    Build()

The resulting model is equivalent to one loaded from model.conf.

Design Notes

  • The builder does not replace model.conf
  • Core enforcement logic remains unchanged
  • Effect and matcher expressions are generated using existing Casbin semantics
  • The builder provides a structured way to construct commonly used model patterns

Effect and matcher definitions may be derived from previously defined sections, such as request and policy fields, but are ultimately emitted as standard Casbin expressions.

Scope

In scope

  • Programmatic construction of model sections
  • Generating standard Casbin models

Out of scope

  • Introducing a new DSL or matcher language
  • Enforce-time validation or semantic changes

</issue_description>

Comments on the Issue (you are @copilot in this section)

@hsluoyz don't add so many test files. only builder_test.go is enough. builder_test.go only needs to contain two test cases, which is the builder version of below RBAC and ABAC tests. (reuse testEnforce)
func TestRBACModel(t *testing.T) {
	e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

	testEnforce(t, e, "alice", "data1", "read", true)
	testEnforce(t, e, "alice", "data1", "write", false)
	testEnforce(t, e, "alice", "data2", "read", true)
	testEnforce(t, e, "alice", "data2", "write", true)
	testEnforce(t, e, "bob", "data1", "read", false)
	testEnforce(t, e, "bob", "data1", "write", false)
	testEnforce(t, e, "bob", "data2", "read", false)
	testEnforce(t, e, "bob", "data2", "write", true)
}

func TestABACModel(t *testing.T) {
	e, _ := NewEnforcer("examples/abac_model.conf")

	data1 := newTestResource("data1", "alice")
	data2 := newTestResource("data2", "bob")

	testEnforce(t, e, "alice", data1, "read", true)
	testEnforce(t, e, "alice", data1, "write", true)
	testEnforce(t, e, "alice", data2, "read", false)
	testEnforce(t, e, "alice", data2, "write", false)
	testEnforce(t, e, "bob", data1, "read", false)
	testEnforce(t, e, "bob", data1, "write", false)
	testEnforce(t, e, "bob", data2, "read", true)
	testEnforce(t, e, "bob", data2, "write", true)
}

the new Go files' Apache header should be year 2026

the builder should have a ToString method to print the model text out


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 2 commits January 4, 2026 15:14
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add programmatic model builder for Casbin models Add programmatic model builder API Jan 4, 2026
Copilot AI requested a review from hsluoyz January 4, 2026 15:22
@hsluoyz hsluoyz marked this pull request as ready for review January 8, 2026 03:50
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Benchmark Comparison

Comparing base branch (b190fce)
vs PR branch (53b6cfc)

goos: linux
goarch: amd64
pkg: github.com/casbin/casbin/v3
cpu: AMD EPYC 7763 64-Core Processor                
                                                 │ base-bench.txt │             pr-bench.txt             │
                                                 │     sec/op     │    sec/op     vs base                │
CachedRaw-4                                          17.65n ± ∞ ¹   17.71n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedBasicModel-4                                   172.6n ± ∞ ¹   167.2n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModel-4                                    177.0n ± ∞ ¹   167.4n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelSmall-4                               188.2n ± ∞ ¹   180.0n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMedium-4                              191.5n ± ∞ ¹   181.0n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelLarge-4                               170.6n ± ∞ ¹   157.8n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithResourceRoles-4                   175.9n ± ∞ ¹   170.8n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDomains-4                         183.2n ± ∞ ¹   175.4n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedABACModel-4                                    2.810µ ± ∞ ¹   2.758µ ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedKeyMatchModel-4                                192.9n ± ∞ ¹   181.5n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDeny-4                            173.8n ± ∞ ¹   169.4n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedPriorityModel-4                                174.0n ± ∞ ¹   168.9n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedWithEnforceContext-4                           298.1n ± ∞ ¹   281.7n ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMediumParallel-4                      178.5n ± ∞ ¹   176.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicySmall-4                                     529.8n ± ∞ ¹   499.5n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyMedium-4                                    553.5n ± ∞ ¹   563.6n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyLarge-4                                     567.4n ± ∞ ¹   585.8n ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicySmall-4                                     520.2n ± ∞ ¹   573.3n ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyMedium-4                                    625.1n ± ∞ ¹   612.8n ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyLarge-4                                     1.263µ ± ∞ ¹   1.281µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicySmall-4                                  523.7n ± ∞ ¹   540.6n ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyMedium-4                                 584.9n ± ∞ ¹   575.8n ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyLarge-4                                  615.4n ± ∞ ¹   615.5n ± ∞ ¹       ~ (p=1.000 n=1) ²
Raw-4                                                17.63n ± ∞ ¹   17.63n ± ∞ ¹       ~ (p=1.000 n=1) ³
BasicModel-4                                         3.531µ ± ∞ ¹   3.526µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModel-4                                          5.305µ ± ∞ ¹   5.331µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/small-4                               49.38µ ± ∞ ¹   48.72µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/medium-4                              509.6µ ± ∞ ¹   489.8µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/large-4                               5.318m ± ∞ ¹   5.380m ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSmall-4                                     58.88µ ± ∞ ¹   59.48µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelMedium-4                                    579.2µ ± ∞ ¹   575.1µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelLarge-4                                     5.909m ± ∞ ¹   5.887m ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithResourceRoles-4                         5.232µ ± ∞ ¹   5.168µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomains-4                               5.002µ ± ∞ ¹   5.077µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACModel-4                                          2.762µ ± ∞ ¹   2.747µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACRuleModel-4                                      4.150m ± ∞ ¹   4.179m ± ∞ ¹       ~ (p=1.000 n=1) ²
KeyMatchModel-4                                      6.035µ ± ∞ ¹   5.976µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDeny-4                                  6.758µ ± ∞ ¹   6.681µ ± ∞ ¹       ~ (p=1.000 n=1) ²
PriorityModel-4                                      4.140µ ± ∞ ¹   4.103µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomainPatternLarge-4                    13.35µ ± ∞ ¹   13.28µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerSmall-4                                   70.02µ ± ∞ ¹   68.66µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerMedium-4                                  734.1µ ± ∞ ¹   724.7µ ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerLarge-4                                   8.051m ± ∞ ¹   8.101m ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternLarge-4                     334.3m ± ∞ ¹   333.2m ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithDomainPatternLarge-4               11.74m ± ∞ ¹   11.83m ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternAndDomainPatternLarge-4     342.5m ± ∞ ¹   340.2m ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternLarge-4                            1.125µ ± ∞ ¹   1.099µ ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithDomainPatternLarge-4                      479.8n ± ∞ ¹   482.9n ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternAndDomainPatternLarge-4            1.143µ ± ∞ ¹   1.097µ ± ∞ ¹       ~ (p=1.000 n=1) ²
ConcurrentHasLinkWithMatching-4                      1.980µ ± ∞ ¹   1.950µ ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                              5.418µ         5.352µ        -1.22%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05
³ all samples are equal

                                                 │ base-bench.txt │             pr-bench.txt              │
                                                 │      B/op      │     B/op       vs base                │
CachedRaw-4                                           0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedBasicModel-4                                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModel-4                                     104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelSmall-4                                104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMedium-4                               104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelLarge-4                                96.00 ± ∞ ¹     96.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithResourceRoles-4                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDomains-4                          120.0 ± ∞ ¹     120.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedABACModel-4                                   1.508Ki ± ∞ ¹   1.504Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
CachedKeyMatchModel-4                                 152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDeny-4                             104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedPriorityModel-4                                 104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedWithEnforceContext-4                            240.0 ± ∞ ¹     240.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMediumParallel-4                       105.0 ± ∞ ¹     105.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicySmall-4                                      150.0 ± ∞ ¹     150.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyMedium-4                                     157.0 ± ∞ ¹     157.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyLarge-4                                      165.0 ± ∞ ¹     165.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicySmall-4                                      152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyMedium-4                                     169.0 ± ∞ ¹     169.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyLarge-4                                      468.0 ± ∞ ¹     443.0 ± ∞ ¹       ~ (p=1.000 n=1) ³
RemovePolicySmall-4                                   166.0 ± ∞ ¹     166.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyMedium-4                                  174.0 ± ∞ ¹     174.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyLarge-4                                   181.0 ± ∞ ¹     181.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
Raw-4                                                 0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
BasicModel-4                                        1.473Ki ± ∞ ¹   1.472Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModel-4                                         2.019Ki ± ∞ ¹   2.013Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/small-4                              19.77Ki ± ∞ ¹   19.85Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/medium-4                             187.3Ki ± ∞ ¹   187.2Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/large-4                              1.810Mi ± ∞ ¹   1.810Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSmall-4                                    19.87Ki ± ∞ ¹   19.90Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelMedium-4                                   190.1Ki ± ∞ ¹   190.1Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelLarge-4                                    1.843Mi ± ∞ ¹   1.844Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithResourceRoles-4                        2.672Ki ± ∞ ¹   2.670Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithDomains-4                              1.787Ki ± ∞ ¹   1.783Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
ABACModel-4                                         1.501Ki ± ∞ ¹   1.498Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
ABACRuleModel-4                                     1.267Mi ± ∞ ¹   1.267Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
KeyMatchModel-4                                     2.997Ki ± ∞ ¹   2.995Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithDeny-4                                 2.424Ki ± ∞ ¹   2.421Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
PriorityModel-4                                     1.721Ki ± ∞ ¹   1.722Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithDomainPatternLarge-4                   8.489Ki ± ∞ ¹   8.486Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RoleManagerSmall-4                                  11.67Ki ± ∞ ¹   11.67Ki ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerMedium-4                                 123.0Ki ± ∞ ¹   123.0Ki ± ∞ ¹       ~ (p=1.000 n=1) ³
RoleManagerLarge-4                                  1.287Mi ± ∞ ¹   1.287Mi ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternLarge-4                    85.95Mi ± ∞ ¹   85.95Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithDomainPatternLarge-4              4.489Mi ± ∞ ¹   4.490Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithPatternAndDomainPatternLarge-4    87.64Mi ± ∞ ¹   87.70Mi ± ∞ ¹       ~ (p=1.000 n=1) ³
HasLinkWithPatternLarge-4                             177.0 ± ∞ ¹     177.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithDomainPatternLarge-4                       80.00 ± ∞ ¹     80.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternAndDomainPatternLarge-4             177.0 ± ∞ ¹     177.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
ConcurrentHasLinkWithMatching-4                       622.0 ± ∞ ¹     622.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                         ⁴                  -0.12%               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

                                                 │ base-bench.txt │             pr-bench.txt             │
                                                 │   allocs/op    │  allocs/op    vs base                │
CachedRaw-4                                           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedBasicModel-4                                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModel-4                                     4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelSmall-4                                4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMedium-4                               4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelLarge-4                                3.000 ± ∞ ¹    3.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithResourceRoles-4                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDomains-4                          4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedABACModel-4                                     18.00 ± ∞ ¹    18.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedKeyMatchModel-4                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelWithDeny-4                             4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedPriorityModel-4                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedWithEnforceContext-4                            5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
CachedRBACModelMediumParallel-4                       4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicySmall-4                                      6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyMedium-4                                     6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasPolicyLarge-4                                      7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicySmall-4                                      6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyMedium-4                                     7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
AddPolicyLarge-4                                      9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicySmall-4                                   7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyMedium-4                                  7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
RemovePolicyLarge-4                                   8.000 ± ∞ ¹    8.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
Raw-4                                                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
BasicModel-4                                          17.00 ± ∞ ¹    17.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModel-4                                           35.00 ± ∞ ¹    35.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/small-4                                480.0 ± ∞ ¹    480.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelSizes/medium-4                              4.829k ± ∞ ¹   4.828k ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSizes/large-4                               48.12k ± ∞ ¹   48.12k ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelSmall-4                                      615.0 ± ∞ ¹    615.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelMedium-4                                    6.018k ± ∞ ¹   6.018k ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelLarge-4                                     60.27k ± ∞ ¹   60.30k ± ∞ ¹       ~ (p=1.000 n=1) ³
RBACModelWithResourceRoles-4                          28.00 ± ∞ ¹    28.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomains-4                                25.00 ± ∞ ¹    25.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACModel-4                                           17.00 ± ∞ ¹    17.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
ABACRuleModel-4                                      40.09k ± ∞ ¹   40.09k ± ∞ ¹       ~ (p=1.000 n=1) ²
KeyMatchModel-4                                       37.00 ± ∞ ¹    37.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDeny-4                                   49.00 ± ∞ ¹    49.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
PriorityModel-4                                       22.00 ± ∞ ¹    22.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RBACModelWithDomainPatternLarge-4                     72.00 ± ∞ ¹    72.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerSmall-4                                    797.0 ± ∞ ¹    797.0 ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerMedium-4                                  8.741k ± ∞ ¹   8.741k ± ∞ ¹       ~ (p=1.000 n=1) ²
RoleManagerLarge-4                                   89.74k ± ∞ ¹   89.74k ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternLarge-4                     3.600M ± ∞ ¹   3.600M ± ∞ ¹       ~ (p=1.000 n=1) ³
BuildRoleLinksWithDomainPatternLarge-4               145.2k ± ∞ ¹   145.2k ± ∞ ¹       ~ (p=1.000 n=1) ²
BuildRoleLinksWithPatternAndDomainPatternLarge-4     3.679M ± ∞ ¹   3.679M ± ∞ ¹       ~ (p=1.000 n=1) ³
HasLinkWithPatternLarge-4                             13.00 ± ∞ ¹    13.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithDomainPatternLarge-4                       5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=1) ²
HasLinkWithPatternAndDomainPatternLarge-4             13.00 ± ∞ ¹    13.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
ConcurrentHasLinkWithMatching-4                       21.00 ± ∞ ¹    21.00 ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                         ⁴                 +0.00%               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

🤖 This comment will be automatically updated with the latest benchmark results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Programmatic model builder

3 participants